package com.cskaoyan._05stringbuffer;

/**
 * @description:
 * @author: 景天
 * @date: 2023/2/16 14:50
 **/
/*
StringBuffer<--->String
 */
public class Demo3 {
    public static void main(String[] args) {
        // String----->StringBuffer
        String s = "abc";
        // 通过StringBuffer的构造方法
        StringBuffer sb = new StringBuffer(s);
        System.out.println(sb);

        // StringBuffer--->String
        String str = sb.toString();
        System.out.println(str);
    }
}
